/*
 * @Author: LVGRAPE
 * @LastEditors: LVGRAPE
 */
#ifndef __SPEAKER_H_
#define __SPEAKER_H_
#include "usr_def.h"

typedef enum {
    _1_do = 261,
    _2_re = 293,
    _3_mi = 329,
    _4_fa = 349,
    _5_so = 392,
    _6_la = 440,
    _7_si = 493,
    _11_do = 523,
    _12_re = 587,
    _13_mi = 659,
    _14_fa = 698,
    _15_so = 783,
    _16_la = 880,
    _17_si = 987,
    _21_do = 1046,
    _22_re = 1174,
    _23_mi = 1318,
    _24_fa = 1396,
    _25_so = 1567,
    _26_la = 1760,
    _27_si = 1975,
} music_note_t;
void speaker_out(uint16_t freq, uint16_t time);
void speaker_init(void);
void speaker_play_handle();
int8_t speaker_play(char *tones, uint8_t len, uint16_t beats, uint8_t x1);
extern code uint16_t music_note_freq[21];
extern bit tones_playing;
#endif // !__SPEAKER_H_
